// Problem: P1008 [NOIP1998 普及组] 三连击
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1008
// Memory Limit: 64 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)



#include<iostream>
#include<string.h>
using namespace std;

int a[10];

int main()
{
	for(int i=167;i<=329;++i)
	{
		memset(a,0,sizeof a);
		a[i%10]=a[i/10%10]=a[i/100]=a[i*2%10]=a[i*2/10%10]=a[i*2/100]=a[i*3%10]=a[i*3/10%10]=a[i*3/100]=1;
		int v=0;
		for(int j=1;j<=9;++j) v+=a[j];
		if(v==9) printf("%d %d %d\n",i,i*2,i*3); 
	}
	return 0;
}